<?php

/**
 * 
 * Creation de la connection
 *
 */
class ConnectionFactory {
	private static $connection = null;
	
	/**
	 */
	private function __construct() {
		// empty method
	}
	
	/**
	 *
	 * @return la connection
	 */
	public static function getConnection() {
		if (self::$connection == null) {
			try {
				self::$connection = mysql_connect ( 'localhost', 'root', 'Password01' );
				mysql_select_db ( 'ibeacon', self::$connection );
			} catch ( Exception $e ) {
				echo "Erreur : " . $e->getMessage ();
			}
		}
		return self::$connection;
	}
}


